from django.db import models

# Create your models here.
class ChatFiles(models.Model):
    """
    ChatFiles
    """
    id = models.BigAutoField(primary_key=True)
    user_id = models.IntegerField(verbose_name="用户ID", null=False, blank=False, default=0)
    name = models.CharField(verbose_name="文件名称", max_length=256, blank=False, null=False, default="")
    obj_key = models.CharField(verbose_name="在服务端保存的路径", max_length=256, blank=False, null=False, default="")
    url = models.CharField(verbose_name="文件访问位置", max_length=256, blank=False, null=False, default="")
    ext = models.CharField(verbose_name="文件类型", max_length=256, blank=False, null=False, default="")
    size = models.IntegerField(verbose_name="文件大小", null=False, blank=False, default=0)
    img = models.FileField(verbose_name='文件相对路径',max_length=128,upload_to='uploads/%Y/%m/%d/',null=False, blank=False, default='')
    created_at = models.DateTimeField(auto_now_add=True)
    avatar = models.BooleanField(verbose_name="是否是头像", default=False)
